﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ZombieState_Attack : StateBase<Zombie>
{

    public ZombieState_Attack(string name)
    {
        this.StateName = name;
    }

    public override void StateEnter(Zombie entity)
    {
        Debug.Log(Time.time + "殭屍進入攻擊狀態");
    }

    public override void StateExit(Zombie entity)
    {
        Debug.Log(Time.time + "殭屍退出攻擊狀態");
    }

    public override void Update(Zombie entity)
    {
        if (Vector3.Distance(entity.transform.position, entity.target.position) > 1.5f)
        {
            entity.ChageState("Track");
        }
    }
}
